import request from '../utils/request'

interface IRoomList {
  "shopId": string,
  "shopName": string,
  "adress": string,
  "shopProvince": string,
  "tel": string,
  "number": number
}
interface IRoomCategoryProps{
  label: string,
  value: string,
  id: number,
  name: string,
  data: [
    {
      id: number,
      name: string,
    }
  ]
}

interface IDeskItem {
  deskNumber: string,
  count: string,
  deskId: string,
}

interface IDeskItemParams {
  deskNumber: string,
  count: string,
}
// 获取门店列表详细信息
export const getRoomDetailApi = (_page:number,_limit:number) => request.get<any, IRoomList[]>(`/shopRoom?_page=${_page}&_limit=${_limit}`)

// 根据 门店和手机号来获取food信息
export const getFoodByShopNameAndApi = (shopName: string, tel: string) => request.get<any, IRoomList[]>(`/shopRoom?shopName=${shopName}&tel=${tel}`)

// 获取所有门店信息
export const getRoomDetailListApi = () => request.get<any, IRoomList[]>('/shopRoom')
// 获取桌位管理
export const getDeakListApi = () => request.get<any, IDeskItem[]>('/deskManager')

// 根据关键词搜索 
export const getDeakListItemApi = (deskNumber: string) => request.get(`/deskManager?deskNumber=${deskNumber}`)

// 删除某个桌位
export const deleteDeskApi = (deskId: string) => request.delete(`/deskManager/${deskId}`)


// 添加桌位和人数
export const postAddDeskApi = (params: IDeskItemParams) => request.post<any, IDeskItem>('/deskManager',params)
// 获取全部门店分类
export const getRoomListApi = () => request.get<any, IRoomCategoryProps[]>('/room')